import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image, Picker, Swiper, SwiperItem } from '@tarojs/components'
import {AtTag, AtInput, AtButton, AtCheckbox, AtImagePicker, AtToast, AtTextarea, AtTabs, AtTabsPane, AtRadio, AtCurtain, AtModal, AtModalHeader, AtModalContent, AtModalAction} from 'taro-ui'
import './createCourse.scss'
import reactMixin  from 'react-mixin'
import myJs from './createCourseJs.js'
import app from '../../../main'
import upload_image from '../../../img/icon_jia.png'
import icon_delete from '../../../img/icon_delete.png'

export default class CreateCourse extends Component {
    constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
    config = {
        navigationBarTitleText: '添加病程'
    }

    init() {
        this.setState({
            tabIndex: 0,
            data: [{}, {}],
            files: [{}],
            pickerChecked: '',
            radioChecked: '',
            cb: false,
            isOpenImage: false,
            image: ''
        });

        this.state.case_course.id = this.$router.params.id;
        this.state.case_course.case_id = this.$router.params.case_id;
        this.state.case_course.type = this.$router.params.type;
        this.setState({
            case_course: this.state.case_course
        });

        if (app.isEmpty(this.state.case_course.id)) {
            Taro.setNavigationBarTitle({title: '添加病程'});
        } else {
            Taro.setNavigationBarTitle({title: '编辑病程'});
        }

        var tname = '';
        if(this.state.case_course.type == '首诊') {
            tname = "首诊";
        } else {
            tname = "复诊";
        }
        this.getCaseTemplate(tname);
    }

    showImage(image, images) {
        var urls = [];
        for (var i = 0; i < images.length; i++) {
            urls.push(images[i].url);
        }
        app.prviewImage(image, urls);
    }
    closeImage() {
        this.setState({
            isOpenImage: false
        })
    }

    toastClose() {
        this.setState({
            isOpened: false
        });
    }

    showToast(text) {
        this.setState({
            message: text,
            isOpened: true
        });
    }

    nextPage() {
        var me = this;
        if(!me.state.case_course.visit_at) {
            me.showToast('请选择就诊日期');
            return;
        }
        if(this.state.data.length > this.state.page) {
            Taro.pageScrollTo({scrollTop: 0});
            this.setState({page: this.state.page+1});
        } else {
            me.setState({
                submitState: true
            });
            if(this.state.case_course.id) {
                this.updateCourse();
            } else {
                this.createCourse();
            }
        }
    }

    save() {
        var me = this;
        if(!me.state.case_course.visit_at) {
            me.showToast('请选择就诊日期');
            return;
        }
        me.setState({
            submitState: true
        });
        if(this.state.case_course.id) {
            this.updateCourse();
        } else {
            this.createCourse();
        }
    }

    prePage() {
        Taro.pageScrollTo({scrollTop: 0});
        this.setState({page: this.state.page-1});
    }

    atTagClick(id, v) {
        this.state.result.subjects[id].value += v + ',';
        this.setState({
            result: this.state.result
        });
    }

    mradioClick(sid, rid, v) {
        if(this.state.result.subjects[sid].value[rid] == ''){
            console.log(1)
            this.state.result.subjects[sid].value[rid] = v;
            this.setState({
                result: this.state.result
            })
        }else{
            console.log(2)
            this.state.result.subjects[sid].value[rid] = '';
            this.setState({
                    result: this.state.result
            })
        }
    }

    cradioClick(sid, t, i1, i2) {
        if(!this.state.result.subjects[sid].value[t][i1][i2]) {
            this.state.result.subjects[sid].value[t][i1][i2] = 'true';
        } else {
            this.state.result.subjects[sid].value[t][i1][i2] = '';
        }
        
        this.setState({
            result: this.state.result
        });
    }

    mcheckboxClick(sid, rid, v, i, k) {
        if(this.state.result.subjects[sid].value[rid] && this.state.result.subjects[sid].value[rid].indexOf(v) >= 0) {
            this.state.result.subjects[sid].value[rid] = this.state.result.subjects[sid].value[rid].replace(v, '');
            this.state.result.subjects[sid].state[i][k] = false;
        } else {
            this.state.result.subjects[sid].value[rid] += v;
            this.state.result.subjects[sid].state[i][k] = true;
        }
        
        this.setState({
            result: this.state.result
        });
    }

    imageFail() {
    }

    imageClick(index, file) {
        this.showImage(file.url, [{url: file.url}]);
    }

    render () {
        var p = this.state.page;
        return (
            <View className='createCourse'>
                <AtCurtain
                    isOpened={this.state.isOpenImage}
                    onClose={this.closeImage.bind(this)}
                >
                    <Image
                    style='width:100%;'
                    src={app.getPath(this.state.image)}
                    />
                </AtCurtain>
                <AtToast onClose={this.toastClose} hasMask={true} isOpened={this.state.isOpened} text={this.state.message} icon="alert-circle"></AtToast>
                <View className="title">
                    <Text className="txt">
                        {this.state.case_template.name} 
                    </Text>
                </View>

                <View className={p == 1 ? 'subject': 'hidden'}>
                    <View className="txt">
                        <Text>{this.state.case_template.name == '手术' ? '手术日期' : '就诊日期'}</Text>
                    </View>
                    <Picker mode='date' onChange={this.handleDetailChange.bind(this, 'case_course.visit_at')}>
                        <View className='picker'>
                        {
                            this.state.case_course.visit_at ? 
                            <Text>{this.state.case_course.visit_at}</Text>: 
                            <Text className="placeholderClass">{this.state.case_template.name == '手术' ? '请选择手术日期' : '请选择就诊日期'}</Text>
                        }
                        </View>
                    </Picker>
                </View>

                {
                    this.state.template.map((page)=>{
                    return (<View className={page.page == p ? "show": "hidden"}>
                        <View>
                            {
                                page.subjects.map((subject)=>{
                                    return subject.type == "单选题"? 
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1')}
                                                options={subject.options}
                                            />
                                            <AtInput value={this.state.result.subjects[subject.id].value.v2} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2')} className={subject.hasOtherInput? '': 'hidden'} type="text" placeholder="选择其他时需要填写"/>
                                        </View>
                                    ) : 
                                    (subject.type == "多选题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <View>
                                                <AtCheckbox selectedList={this.state.result.subjects[subject.id].value.v1} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1')} options={subject.options}/>
                                            </View>
                                            <View>
                                                <AtInput value={this.state.result.subjects[subject.id].value.v2} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2')} className={subject.hasOtherInput? 'control': 'hidden'} type="text" placeholder="选择其他时需要填写"/>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "填空题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <View>
                                                <AtInput type="text" className="control" value={this.state.result.subjects[subject.id].value} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value')}/>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "多行填空题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <View>
                                                <AtTextarea count={false} maxLength={200} className="control" value={this.state.result.subjects[subject.id].value} onChange={this.handleTextareaChange.bind(this, 'result.subjects.' + subject.id + '.value')}/>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "选项填空题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <View>
                                                <AtTextarea count={false} maxLength={200} className="control" value={this.state.result.subjects[subject.id].value} onChange={this.handleTextareaChange.bind(this, 'result.subjects.' + subject.id + '.value')}/>
                                            </View>
                                            <View className='at-row at-row--wrap panel'>
                                                {
                                                    subject.options.map((opt)=>{
                                                        return (
                                                            <View className='at-col at-col-1 at-col--auto element'>
                                                                <AtTag onClick={this.atTagClick.bind(this, subject.id, opt)} type='primary' active={false}>{opt}</AtTag>
                                                            </View>
                                                        )
                                                    })
                                                }
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "文本描述"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "矩阵填空题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            <View className="group">
                                                {
                                                    subject.items.map((it, index)=>{
                                                        return (
                                                            <View className="subject">
                                                                <View className="txt">
                                                                    <Text>{it.label}</Text>
                                                                </View>
                                                                <View>
                                                                    <AtInput type="text" className="control" value={this.state.result.subjects[subject.id].value['v'+(index+1)]} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v' + (index+1))}/>
                                                                </View>
                                                            </View>
                                                        )
                                                    })
                                                }
                                                
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "矩阵单选题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            
                                            <View className="matrix">
                                                <View className='header at-row at-row__justify--around'>
                                                    {
                                                        subject.xItems.map((it)=>{
                                                            return <View className='at-col at-col-2 at-col--wrap'>{it}</View>
                                                        })
                                                    }
                                                </View>
                                                <View className="content">
                                                    {
                                                        subject.yItems.map((it, i)=>{
                                                            return (<View className="item">
                                                                <View className="txt">
                                                                    {it}
                                                                </View>
                                                                <View className='options at-row at-row__justify--around'>
                                                                    {
                                                                        subject.xItems.map((xit)=>{
                                                                            return (
                                                                                <View className='at-col at-col-2 at-col--wrap' onClick={this.mradioClick.bind(this, subject.id, 'v' + (i + 1), xit)}>
                                                                                    <Image className={this.state.result.subjects[subject.id].value['v' + (i + 1)] != xit? 'icon': 'icon hidden'} src={app.imageUri+'images/radio-u.png'}/>
                                                                                    <Image className={this.state.result.subjects[subject.id].value['v' + (i + 1)] == xit? 'icon': 'icon hidden'} src={app.imageUri+'images/radio-c.png'}/>
                                                                                </View>
                                                                            )
                                                                            
                                                                        })
                                                                    }
                                                                </View>
                                                            </View>)
                                                        })
                                                    }
                                                </View>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "矩阵多选题"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>
                                            
                                            <View className="matrix">
                                                <View className='header at-row at-row__justify--around'>
                                                    {
                                                        subject.xItems.map((it)=>{
                                                            return <View className='at-col at-col-2 at-col--wrap'>{it}</View>
                                                        })
                                                    }
                                                </View>
                                                <View className="content">
                                                    {
                                                        subject.yItems.map((it, i)=>{
                                                            return (<View className="item">
                                                                <View className="txt">
                                                                    {it}
                                                                </View>
                                                                <View className='options at-row at-row__justify--around'>
                                                                    {
                                                                        subject.xItems.map((xit, k)=>{
                                                                            return (
                                                                                <View className='at-col at-col-2 at-col--wrap' onClick={this.mcheckboxClick.bind(this, subject.id, 'v' + (i + 1), xit+',', i, k)}>
                                                                                    <Image className={!this.state.result.subjects[subject.id].state[i][k] ? 'icon': 'icon hidden'} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                                    <Image className={this.state.result.subjects[subject.id].state[i][k] ? 'icon': 'icon hidden'} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                                </View>
                                                                            )
                                                                        })
                                                                    }
                                                                </View>
                                                            </View>)
                                                        })
                                                    }
                                                </View>
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "上传图片"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>

                                            <View className='at-row at-row--wrap'>
                                                {
                                                    subject.items.map((it, i)=>{
                                                        return (
                                                            <View className="at-col at-col-3 img">
                                                                <AtImagePicker showAddBtn={this.state.result.subjects[subject.id].state[i]} onFailClick={this.imageFail.bind(this)} onImageClick={this.imageClick.bind(this)} onChange={this.imageChange.bind(this, subject.id, i)} multiple={false} length={1} files={this.state.result.subjects[subject.id].value['v'+(i+1)]}/>
                                                                <Text className="note">{it}</Text>
                                                            </View>
                                                        )
                                                    })
                                                }
                                            </View>
                                        </View>
                                    ): 
                                    (subject.type == "眼科检查"?
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>

                                            <AtTabs current={this.state.tabIndex} tabList={[{ title: '右眼' }, { title: '左眼' }]} onClick={this.handleChange.bind(this, 'tabIndex')}>
                                                <AtTabsPane current={this.state.tabIndex} index={0}>
                                                    <View>
                                                        <View className={this.state.result.subjects[subject.id].displays['裸眼视力']?'':'hidden'}>
                                                            <AtInput placeholder='请输入' value={this.state.result.subjects[subject.id].value.v2['裸眼视力'].v1} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.裸眼视力.v1')} title='裸眼视力' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['矫正视力']?'component-panel':'hidden'}>
                                                            <View className="component-label">矫正视力</View>
                                                            <View className="component flex-start">
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['矫正视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.矫正视力.v1')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DS/</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['矫正视力'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.矫正视力.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DC X</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['矫正视力'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.矫正视力.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">° -></Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['矫正视力'].v4} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.矫正视力.v4')}  
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['光定位']?'component-panel':'hidden'}>
                                                            <View className="component-label">光定位</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['光定位'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.光定位.v1')}
                                                                options={[
                                                                    { label: '准', value: '准' },
                                                                    { label: '不准', value: '不准' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['色觉']?'component-panel':'hidden'}>
                                                            <View className="component-label">色觉</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['色觉'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.色觉.v1')}
                                                                options={[
                                                                    { label: '红绿可辨', value: '红绿可辨' },
                                                                    { label: '红绿不可辨', value: '红绿不可辨' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼睑']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼睑</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['眼睑'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼睑.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '红肿', value: '红肿' },
                                                                    { label: '内翻', value: '内翻' },
                                                                    { label: '外翻', value: '外翻' },
                                                                    { label: '下垂', value: '下垂' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['眼睑'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼睑.v2')}  
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['睫毛']?'component-panel':'hidden'}>
                                                            <View className="component-label">睫毛</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['睫毛'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.睫毛.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '倒睫', value: '倒睫' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼位']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼位</View>
                                                            <View className="component flex-start">
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v1')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v1?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v1')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v1?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">眼位正</Text>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v2')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v2?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v2')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v2?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">外斜 </Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['眼位'].v2 && this.state.result.subjects[subject.id].value.v2['眼位'].v2 != 'true'?this.state.result.subjects[subject.id].value.v2['眼位'].v2:''} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼位.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">°</Text>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v3')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v3?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v3')} className={this.state.result.subjects[subject.id].value.v2['眼位'].v3?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">内斜</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['眼位'].v3 && this.state.result.subjects[subject.id].value.v2['眼位'].v3 != 'true'?this.state.result.subjects[subject.id].value.v2['眼位'].v3:''} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼位.v3')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">°</Text>
                                                            </View>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼球']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼球</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['眼球'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼球.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '异常', value: '异常' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['结膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">结膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['结膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.结膜.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '轻充血', value: '轻充血' },
                                                                    { label: '明显充血', value: '明显充血' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['泪道冲洗']?'component-panel':'hidden'}>
                                                            <View className="component-label">泪道冲洗</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['泪道冲洗'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.泪道冲洗.v1')}
                                                                options={[
                                                                    { label: '通畅', value: '通畅' },
                                                                    { label: '不通无分泌物', value: '不通无分泌物' },
                                                                    { label: '脓性分泌物', value: '脓性分泌物' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['胬肉']?'component-panel':'hidden'}>
                                                            <View className="component-label">胬肉</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['胬肉'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.胬肉.v1')}
                                                                options={[
                                                                    { label: '无', value: '无' },
                                                                    { label: '至角膜缘', value: '至角膜缘' },
                                                                    { label: '角膜缘与瞳孔圆之间', value: '角膜缘与瞳孔圆之间' },
                                                                    { label: '至瞳孔缘', value: '至瞳孔缘' },
                                                                    { label: '越过瞳孔缘', value: '越过瞳孔缘' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['角膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">角膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['角膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.角膜.v1')}
                                                                options={[
                                                                    { label: '透明', value: '透明' },
                                                                    { label: '云翳', value: '云翳' },
                                                                    { label: '斑翳', value: '斑翳' },
                                                                    { label: '白斑', value: '白斑' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['前房']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">前房</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v2['前房'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.前房.v1')}
                                                                    options={[
                                                                        { label: '正常', value: '正常' },
                                                                        { label: '浅', value: '浅' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            <View className="component flex-start pdleft">
                                                                <Text className="c-txt">轴深</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['前房'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.前房.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">CT</Text>
                                                                <Text className="c-txt">   周深</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['前房'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.前房.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">CT</Text>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['虹膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">虹膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['虹膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.虹膜.v1')}
                                                                options={[
                                                                    { label: '纹理清', value: '纹理清' },
                                                                    { label: '部分萎缩', value: '部分萎缩' },
                                                                    { label: '后粘连', value: '后粘连' },
                                                                    { label: '可见新生血管', value: '可见新生血管' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['虹膜'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.虹膜.v2')} 
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['瞳孔']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">瞳孔</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v2['瞳孔'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.瞳孔.v1')}
                                                                    options={[
                                                                        { label: '对光反射正常', value: '对光反射正常' },
                                                                        { label: '对光反射迟钝', value: '对光反射迟钝' },
                                                                        { label: '对光反射消失', value: '对光反射消失' },
                                                                        { label: '圆', value: '圆' },
                                                                        { label: '不圆', value: '不圆' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            {/*<View className="component flex-start">
                                                                <Text className="c-txt">瞳孔直径</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['瞳孔直径'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.瞳孔直径.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">mm</Text>
                                                            </View>*/}
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['晶状体']?'component-panel':'hidden'}>
                                                            <View className="component-label">晶状体</View>
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">C</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['晶状体'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.晶状体.v1')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">N</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['晶状体'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.晶状体.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">P</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['晶状体'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.晶状体.v3')} 
                                                                    type='text' className="c-input"/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '晶状体', 'v4')} className={this.state.result.subjects[subject.id].value.v2['晶状体'].v4?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '晶状体', 'v4')} className={this.state.result.subjects[subject.id].value.v2['晶状体'].v4?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">IOL</Text>
                                                            </View>
                                                        </View>
                                                        
                                                        <View className={this.state.result.subjects[subject.id].displays['玻璃体']?'component-panel':'hidden'}>
                                                            <View className="component-label">玻璃体</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['玻璃体'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.玻璃体.v1')}
                                                                options={[
                                                                    { label: '清晰', value: '清晰' },
                                                                    { label: '混浊', value: '混浊' },
                                                                    { label: '不能窥入', value: '不能窥入' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['玻璃体'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.玻璃体.v2')} 
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼底']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">眼底</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v2['眼底'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼底.v1')}
                                                                    options={[
                                                                        { label: '眼底正常', value: '眼底正常' },
                                                                        { label: '眼底模糊', value: '眼底模糊' },
                                                                        { label: '色正常', value: '色正常' },
                                                                        { label: '色淡', value: '色淡' },
                                                                        { label: '色苍白', value: '色苍白' },
                                                                        { label: '眼底窥不入', value: '眼底窥不入' },
                                                                        { label: '视网膜正常', value: '视网膜正常' },
                                                                        { label: '黄斑正常', value: '黄斑正常' },
                                                                        { label: '黄斑窥不清', value: '黄斑窥不清' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">视盘C/D</Text>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['眼底'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼底.v2')} 
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['眼压']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['眼压'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.眼压.v2')} 
                                                                    title='眼压' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['A超B超']?'component-panel':'hidden'}>
                                                            <View className="component-label">A超B超</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v2['A超B超'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.A超B超.v1')}
                                                                options={[
                                                                    { label: '清晰', value: '清晰' },
                                                                    { label: '轻度混浊', value: '轻度混浊' },
                                                                    { label: '明显混浊', value: '明显混浊' },
                                                                    { label: '星状变性', value: '星状变性' },
                                                                    { label: '玻璃体后脱离', value: '玻璃体后脱离' },
                                                                    { label: '积血', value: '积血' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['A超B超'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.A超B超.v2')}
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">AL</Text>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['A超B超'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.A超B超.v3')}
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">mm</Text>
                                                            </View>
                                                        </View>
                                                       
                                                        <View className={this.state.result.subjects[subject.id].displays['拱高']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['拱高'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.拱高.v1')}
                                                                    title='拱高' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['内皮细胞数']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['内皮细胞数'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.内皮细胞数.v1')}
                                                                    title='内皮细胞数' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['光焦度']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['光焦度'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.光焦度.v1')}
                                                                    title='光焦度' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['术后裸眼视力']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>术后裸眼视力</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v2['术后裸眼视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术后裸眼视力.v1')} 
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                        <View  className={this.state.result.subjects[subject.id].displays['散瞳验光']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v2['散瞳验光'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.散瞳验光.v1')} 
                                                                    title='散瞳验光' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['术前最佳矫正视力']?'component-panel':'hidden'}>
                                                            <View className="component-label">术前最佳矫正视力</View>
                                                            <View className="component flex-start">
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['术前最佳矫正视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术前最佳矫正视力.v1')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DS/</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['术前最佳矫正视力'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术前最佳矫正视力.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DC X</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['术前最佳矫正视力'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术前最佳矫正视力.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">° -></Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v2['术前最佳矫正视力'].v4} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术前最佳矫正视力.v4')}  
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>
                                                        <View  className={this.state.result.subjects[subject.id].displays['术前眼压（mmHg）']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>术前眼压（mmHg）</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v2['术前眼压（mmHg）'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.术前眼压（mmHg）.v2')} 
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['前房深度ACD（mm）']?'':'hidden'}>
                                                            <View  className={this.state.result.subjects[subject.id].displays['前房深度ACD（mm）']?'':'hidden'}>
                                                                <View className='form_input'>
                                                                    <View className='f_label'>前房深度ACD（mm）</View>
                                                                    <AtInput 
                                                                        placeholder='请输入'
                                                                        className='f_input'
                                                                        border={false}
                                                                        value={this.state.result.subjects[subject.id].value.v2['前房深度ACD（mm）'].v1} 
                                                                        onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.前房深度ACD（mm）.v1')} 
                                                                        title='' type='text'/>
                                                                </View>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['角膜内皮细胞计数（个/mm2）']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>角膜内皮细胞计数（个/mm2）</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v2['角膜内皮细胞计数（个/mm2）'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v2.角膜内皮细胞计数（个/mm2）.v1')}
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                    </View>
                                                </AtTabsPane>
                                                <AtTabsPane current={this.state.tabIndex} index={1} >
                                                    <View>
                                                        <View className={this.state.result.subjects[subject.id].displays['裸眼视力']?'':'hidden'}>
                                                            <AtInput placeholder='请输入' value={this.state.result.subjects[subject.id].value.v1['裸眼视力'].v1} onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.裸眼视力.v1')} title='裸眼视力' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['矫正视力']?'component-panel':'hidden'}>
                                                            <View className="component-label">矫正视力</View>
                                                            <View className="component flex-start">
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['矫正视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.矫正视力.v1')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DS/</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['矫正视力'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.矫正视力.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DC X</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['矫正视力'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.矫正视力.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">° -></Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['矫正视力'].v4} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.矫正视力.v4')}  
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['光定位']?'component-panel':'hidden'}>
                                                            <View className="component-label">光定位</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['光定位'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.光定位.v1')}
                                                                options={[
                                                                    { label: '准', value: '准' },
                                                                    { label: '不准', value: '不准' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['色觉']?'component-panel':'hidden'}>
                                                            <View className="component-label">色觉</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['色觉'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.色觉.v1')}
                                                                options={[
                                                                    { label: '红绿可辨', value: '红绿可辨' },
                                                                    { label: '红绿不可辨', value: '红绿不可辨' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼睑']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼睑</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['眼睑'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼睑.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '红肿', value: '红肿' },
                                                                    { label: '内翻', value: '内翻' },
                                                                    { label: '外翻', value: '外翻' },
                                                                    { label: '下垂', value: '下垂' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['眼睑'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼睑.v2')}  
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['睫毛']?'component-panel':'hidden'}>
                                                            <View className="component-label">睫毛</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['睫毛'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.睫毛.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '倒睫', value: '倒睫' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼位']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼位</View>
                                                            <View className="component flex-start">
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v1')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v1?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v1')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v1?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">眼位正</Text>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v2')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v2?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v2')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v2?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">外斜 </Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['眼位'].v2 && this.state.result.subjects[subject.id].value.v1['眼位'].v2 != 'true'?this.state.result.subjects[subject.id].value.v1['眼位'].v2:''} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼位.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">°</Text>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v3')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v3?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '眼位', 'v3')} className={this.state.result.subjects[subject.id].value.v1['眼位'].v3?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">内斜</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['眼位'].v3 && this.state.result.subjects[subject.id].value.v1['眼位'].v3 != 'true'?this.state.result.subjects[subject.id].value.v1['眼位'].v3:''} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼位.v3')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">°</Text>
                                                            </View>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼球']?'component-panel':'hidden'}>
                                                            <View className="component-label">眼球</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['眼球'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼球.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '异常', value: '异常' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['结膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">结膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['结膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.结膜.v1')}
                                                                options={[
                                                                    { label: '正常', value: '正常' },
                                                                    { label: '轻充血', value: '轻充血' },
                                                                    { label: '明显充血', value: '明显充血' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['泪道冲洗']?'component-panel':'hidden'}>
                                                            <View className="component-label">泪道冲洗</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['泪道冲洗'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.泪道冲洗.v1')}
                                                                options={[
                                                                    { label: '通畅', value: '通畅' },
                                                                    { label: '不通无分泌物', value: '不通无分泌物' },
                                                                    { label: '脓性分泌物', value: '脓性分泌物' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['胬肉']?'component-panel':'hidden'}>
                                                            <View className="component-label">胬肉</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['胬肉'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.胬肉.v1')}
                                                                options={[
                                                                    { label: '无', value: '无' },
                                                                    { label: '至角膜缘', value: '至角膜缘' },
                                                                    { label: '角膜缘与瞳孔圆之间', value: '角膜缘与瞳孔圆之间' },
                                                                    { label: '至瞳孔缘', value: '至瞳孔缘' },
                                                                    { label: '越过瞳孔缘', value: '越过瞳孔缘' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['角膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">角膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['角膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.角膜.v1')}
                                                                options={[
                                                                    { label: '透明', value: '透明' },
                                                                    { label: '云翳', value: '云翳' },
                                                                    { label: '斑翳', value: '斑翳' },
                                                                    { label: '白斑', value: '白斑' }
                                                                ]}
                                                            />
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['前房']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">前房</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v1['前房'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.前房.v1')}
                                                                    options={[
                                                                        { label: '正常', value: '正常' },
                                                                        { label: '浅', value: '浅' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            <View className="component flex-start pdleft">
                                                                <Text className="c-txt">轴深</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['前房'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.前房.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">CT</Text>
                                                                <Text className="c-txt">   周深</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['前房'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.前房.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">CT</Text>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['虹膜']?'component-panel':'hidden'}>
                                                            <View className="component-label">虹膜</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['虹膜'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.虹膜.v1')}
                                                                options={[
                                                                    { label: '纹理清', value: '纹理清' },
                                                                    { label: '部分萎缩', value: '部分萎缩' },
                                                                    { label: '后粘连', value: '后粘连' },
                                                                    { label: '可见新生血管', value: '可见新生血管' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['虹膜'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.虹膜.v2')} 
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['瞳孔']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">瞳孔</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v1['瞳孔'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.瞳孔.v1')}
                                                                    options={[
                                                                        { label: '对光反射正常', value: '对光反射正常' },
                                                                        { label: '对光反射迟钝', value: '对光反射迟钝' },
                                                                        { label: '对光反射消失', value: '对光反射消失' },
                                                                        { label: '圆', value: '圆' },
                                                                        { label: '不圆', value: '不圆' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            {/*<View className="component flex-start">
                                                                <Text className="c-txt">瞳孔直径</Text>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['瞳孔直径'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.瞳孔直径.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">mm</Text>
                                                            </View>*/}
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['晶状体']?'component-panel':'hidden'}>
                                                            <View className="component-label">晶状体</View>
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">C</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['晶状体'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.晶状体.v1')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">N</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['晶状体'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.晶状体.v2')} 
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">P</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['晶状体'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.晶状体.v3')} 
                                                                    type='text' className="c-input"/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '晶状体', 'v4')} className={this.state.result.subjects[subject.id].value.v1['晶状体'].v4?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                                                <Image onClick={this.cradioClick.bind(this, subject.id, 'v1', '晶状体', 'v4')} className={this.state.result.subjects[subject.id].value.v1['晶状体'].v4?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                                                <Text className="c-txt">IOL</Text>
                                                            </View>
                                                        </View>
                                                        
                                                        <View className={this.state.result.subjects[subject.id].displays['玻璃体']?'component-panel':'hidden'}>
                                                            <View className="component-label">玻璃体</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['玻璃体'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.玻璃体.v1')}
                                                                options={[
                                                                    { label: '清晰', value: '清晰' },
                                                                    { label: '混浊', value: '混浊' },
                                                                    { label: '不能窥入', value: '不能窥入' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['玻璃体'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.玻璃体.v2')} 
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                        </View>

                                                        <View className={this.state.result.subjects[subject.id].displays['眼底']?'':'hidden'}>
                                                            <View className="component-panel">
                                                                <View className="component-label">眼底</View>
                                                                <AtRadio value={this.state.result.subjects[subject.id].value.v1['眼底'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼底.v1')}
                                                                    options={[
                                                                        { label: '眼底正常', value: '眼底正常' },
                                                                        { label: '眼底模糊', value: '眼底模糊' },
                                                                        { label: '色正常', value: '色正常' },
                                                                        { label: '色淡', value: '色淡' },
                                                                        { label: '色苍白', value: '色苍白' },
                                                                        { label: '眼底窥不入', value: '眼底窥不入' },
                                                                        { label: '视网膜正常', value: '视网膜正常' },
                                                                        { label: '黄斑正常', value: '黄斑正常' },
                                                                        { label: '黄斑窥不清', value: '黄斑窥不清' }
                                                                    ]}
                                                                />
                                                            </View>
                                                            
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">视盘C/D</Text>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['眼底'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼底.v2')} 
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>
                                                        <View  className={this.state.result.subjects[subject.id].displays['眼压']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['眼压'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.眼压.v2')} 
                                                                    title='眼压' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['A超B超']?'component-panel':'hidden'}>
                                                            <View className="component-label">A超B超</View>
                                                            <AtRadio value={this.state.result.subjects[subject.id].value.v1['A超B超'].v1} onClick={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.A超B超.v1')}
                                                                options={[
                                                                    { label: '清晰', value: '清晰' },
                                                                    { label: '轻度混浊', value: '轻度混浊' },
                                                                    { label: '明显混浊', value: '明显混浊' },
                                                                    { label: '星状变性', value: '星状变性' },
                                                                    { label: '玻璃体后脱离', value: '玻璃体后脱离' },
                                                                    { label: '积血', value: '积血' },
                                                                    { label: '其他', value: '其他' },
                                                                ]}
                                                            />
                                                            <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['A超B超'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.A超B超.v2')}
                                                                    type="text" placeholder="选择其他时需要填写"/>
                                                            <View className="component flex-start">
                                                                <Text className="c-txt">AL</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['A超B超'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.A超B超.v3')}
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">mm</Text>
                                                            </View>
                                                        </View>
                                                       
                                                        <View className={this.state.result.subjects[subject.id].displays['拱高']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['拱高'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.拱高.v1')}
                                                                    title='拱高' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['内皮细胞数']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['内皮细胞数'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.内皮细胞数.v1')}
                                                                    title='内皮细胞数' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['光焦度']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['光焦度'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.光焦度.v1')}
                                                                    title='光焦度' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['术后裸眼视力']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>术后裸眼视力</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v1['术后裸眼视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术后裸眼视力.v1')} 
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                        <View  className={this.state.result.subjects[subject.id].displays['散瞳验光']?'':'hidden'}>
                                                            <AtInput 
                                                                    placeholder='请输入'
                                                                    value={this.state.result.subjects[subject.id].value.v1['散瞳验光'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.散瞳验光.v1')} 
                                                                    title='散瞳验光' type='text'/>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['术前最佳矫正视力']?'component-panel':'hidden'}>
                                                            <View className="component-label">术前最佳矫正视力</View>
                                                            <View className="component flex-start">
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['术前最佳矫正视力'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术前最佳矫正视力.v1')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DS/</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['术前最佳矫正视力'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术前最佳矫正视力.v2')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">DC X</Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['术前最佳矫正视力'].v3} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术前最佳矫正视力.v3')}  
                                                                    type='text' className="c-input"/>
                                                                <Text className="c-txt">° -></Text>
                                                                <AtInput 
                                                                    value={this.state.result.subjects[subject.id].value.v1['术前最佳矫正视力'].v4} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术前最佳矫正视力.v4')}  
                                                                    type='text' className="c-input"/>
                                                            </View>
                                                        </View>
                                                        <View  className={this.state.result.subjects[subject.id].displays['术前眼压（mmHg）']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>术前眼压（mmHg）</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v1['术前眼压（mmHg）'].v2} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.术前眼压（mmHg）.v2')} 
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['前房深度ACD（mm）']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>前房深度ACD（mm）</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v1['前房深度ACD（mm）'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.前房深度ACD（mm）.v1')} 
                                                                    title='' type='text'/>
                                                            </View>
                                                        </View>
                                                        <View className={this.state.result.subjects[subject.id].displays['角膜内皮细胞计数（个/mm2）']?'':'hidden'}>
                                                            <View className='form_input'>
                                                                <View className='f_label'>角膜内皮细胞计数（个/mm2）</View>
                                                                <AtInput 
                                                                    placeholder='请输入'
                                                                    className='f_input'
                                                                    border={false}
                                                                    value={this.state.result.subjects[subject.id].value.v1['角膜内皮细胞计数（个/mm2）'].v1} 
                                                                    onChange={this.handleChange.bind(this, 'result.subjects.' + subject.id + '.value.v1.角膜内皮细胞计数（个/mm2）.v1')}
                                                                    title='' type='text'/>
                                                            </View>
                                                            
                                                        </View>
                                                    </View>
                                                </AtTabsPane>
                                            </AtTabs>
                                        </View>
                                    ): 
                                    (subject.type == '普通上传' ? 
                                    (
                                        <View className="subject">
                                            <View className="txt">
                                                <Text>{subject.label}</Text>
                                            </View>

                                            <View className='editCaseImage'>
                                                <AtModal isOpened={this.state.imgModal}>
                                                    <AtModalHeader>请输入照片名称</AtModalHeader>
                                                    <AtModalContent>
                                                        <AtInput type='text' value={this.state.text} onChange={this.handleChange.bind(this, 'text')}/>
                                                    </AtModalContent>
                                                    <AtModalAction>
                                                        <Button onClick={this.closeModal.bind(this)}>取消</Button> 
                                                        <Button onClick={this.comfirmModal.bind(this, subject.id)}>确定</Button>
                                                    </AtModalAction>
                                                </AtModal>
                                                <View className="sub_img">
                                                    {
                                                        this.state.result.subjects[subject.id].value.map((k) => {
                                                            return <View className='item_box'>
                                                                        <View className='item_img'><Image src={k.url} style='width:200rpx;height:200rpx;' mode='widthFix' onClick={this.showImage.bind(this, k.url, this.state.result.subjects[subject.id].value)}></Image></View>
                                                                        <View className='item_txt'>{k.text}</View>
                                                                        <Image src={icon_delete} onClick={this.deleteImage.bind(this, k.url, subject.id)} className='img_delete' style='width:50rpx;height:50rpx;'></Image>
                                                                    </View>
                                                        })
                                                    }
                                                    <View className='upload_box'>
                                                        <View className='icon_upload' onClick={this.imageChange2.bind(this)}>
                                                            <Image src={upload_image} style='width:100rpx;height:100rpx;'></Image>
                                                        </View>
                                                    </View>
                                                </View>
                                            </View>
                                        </View>
                                    ): 
                                    (<View></View>))))))))))))
                                })
                            }
                        </View>
                    </View>)
                    })
                }

                <View className="footer">
                    {
                        (this.state.template.length <= 1)
                        ?
                        <View>
                            <AtButton type='primary' className="save" onClick={this.save.bind(this)}>保存</AtButton>
                        </View>
                        :
                        <View style='display:flex;'>
                            <View style='margin-right:50rpx;'>
                                <AtButton type='secondary' className="btn" disabled={this.state.page <= 1} onClick={this.prePage.bind(this)}>上一页</AtButton>
                            </View>
                            <View>
                                <AtButton disabled={this.state.submitState} type='primary' className="btn" onClick={this.nextPage.bind(this)}>
                                    {this.state.data.length > p?'下一页': '保存'}
                                </AtButton>
                            </View>
                        </View>
                    }
                </View>
            </View>
        );
    }
}

reactMixin.onClass(CreateCourse, myJs);
